<template>
      
  <div class="">
    <header>
      <van-icon name="arrow-left" @click="dels" />
      <p>严选专栏</p>
      <a></a>
    </header>
    <ul>
      <li v-for="item in list" :key="item.id">
        <img :src="item.pic" alt="" />
        <div class="cont">
          <p v-html="item.title" class="title"></p>
          <p v-html="item.descript" class="descript"></p>
          <button class="btn">查看详情</button>
        </div>
      </li>
    </ul>
  </div>
</template>

<script>
import { getlists } from "../utils/api/home.js";
export default {
  data() {
    return {
      list: [],
    };
  },
  mounted() {
    getlists().then((res) => {
      console.log(res);
      this.list = res.data.data;
    });
  },
  methods: {
    dels() {
      this.$router.go(-1);
    },
  },
};
</script>

<style lang='scss' scoped>
header {
  border-bottom: 0.04rem solid #f5f5f5;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 1rem;
  width: 7.5rem;
  padding-left: 0.1rem;
  padding-right: 0.1rem;
  p {
    font-size: 0.33rem;
  }
  .van-icon {
    font-size: 0.4rem;
  }
}

ul {
  > li {
    width: 7.5rem;
    height: 3.82rem;
    position: relative;
    > img {
      width: 100%;
      height: 100%;
    }
  }
}
.cont {
  margin-top: 0.5rem;
  display: flex;
  flex-direction: column;

  justify-content: space-between;
  align-items: center;
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  .title {
    font-size: 0.35rem;
    color: #fff;
    text-align: center;
  }
  .descript {
    margin-top: 0.44rem;
    font-size: 0.4rem;
    text-align: center;

    color: #fff;
    width: 80%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  .btn {
    color: #fff;
    width: 1.6rem;
    height: 0.6rem;
    font-size: 0.3rem;
    background-color: transparent;
    border: 1px solid #fff;
    border-radius: 0.5rem;
    margin-top: 0.4rem;
  }
}
</style>
